package com.ms.demo.demo2;

/**
 * @description: 客户端执行
 * @author: ms
 * @create: 2022-10-28 11:07
 */
public class TestMain {

    public static void main(String[] args) {
        // 创建抽象中介者
        Mediator mediator = new ConcreteMediator();
        // 具体同事类
        ConcreteColleagueA colleagueA = new ConcreteColleagueA(mediator);
        ConcreteColleagueB colleagueB = new ConcreteColleagueB(mediator);
        // 中介者进行转发协作,A转发给B
        colleagueA.depMethodA();
        System.out.println("-------------------------");
        // 中介者进行转发协作,B转发给A
        colleagueB.depMethodB();
    }

}